package com.leetroll.common.enums;

import java.util.Objects;

/**
 * 系统配置key
 */
public enum ECat {
    MODEL("model", 7),
    TEXTURE("texture", 1),
    SOUND("sound", 5),
    IMAGE("image", 6),
    TUTORIAL("tutorial", 3);
    private final String name;
    private final Integer catId;

    ECat(String name, Integer catId) {
        this.name = name;
        this.catId = catId;
    }

    public Integer getCatId() {
        return catId;
    }

    public String getName() {
        return name;
    }

    public static ECat fromName(String name) {
        for (ECat eCat : values()) {
            if (Objects.equals(eCat.getName(), name)) {
                return eCat;
            }
        }
        return null;
    }
}
